package com.example.my930;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.renderscript.Sampler;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;

import java.util.Random;

public class ProgressBarActivity extends AppCompatActivity {

    ProgressBar progressBar;
    Button btnSet,btnStop;
    TextView tvMsg;
    int value=5;
    boolean istop = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_progress_bar);

        progressBar=findViewById(R.id.progressBar);
        btnSet=findViewById(R.id.btnSet);
        btnStop=findViewById(R.id.btnStop);
        tvMsg=findViewById(R.id.tvMsg);

        progressBar.setProgress(value);

        btnSet.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                new Thread();



                Random random=new Random();

                int inValue=random.nextInt(10);
                Log.v("random:","+intValue");

                value += inValue;
                progressBar.setProgress(value);
            }
        });
    }
}
